﻿using System;
using System.Collections.Generic;
using System.Data.Entity.Infrastructure;
using System.Data.Objects;
using System.Linq;
using System.Text;
using System.Data.Entity;


namespace System.Data
{
    /// <summary>
    /// Code First DbContext
    /// </summary>
    public class GenericDbContext : DbContext, IDbContext
    {
        protected GenericDbContext(string nameOrConnectionString):base(nameOrConnectionString)
        {
            ConnectionString = nameOrConnectionString;
        }

        public new IDbSet<TEntity> Set<TEntity>() where TEntity : BaseEntity
        {
            return base.Set<TEntity>();
        }

        public string ConnectionString { get; private set; }

        public ObjectContext ObjectContext
        {
            get { return ((IObjectContextAdapter) this).ObjectContext; }
        }
        void IDisposable.Dispose()
        {
            base.Dispose();
        }
    }
}
